home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Tool Chest / Testing & Debugging / Debuggers & dcmds / MacsBug 6.6 / MacsBug 6.6 Read Me < prev    next >
Encoding:
Text File  |  1999-10-20  |  19.0 KB  |  479 lines  |  [ttro/ttxt]

  1.  About MacsBug 6.6
  2.  
  3.    10/20/99
  4.  
  5.     The following is a complete list of changes to MacsBug since version 6.5.4a6.
  6.  
  7.  
  8.     INSTALLATION INSTRUCTIONS
  9.  
  10.     • MacsBug includes a number of folders. The contents of each is as follows:
  11.  
  12.         “into System Folder” - This contains MacsBug itself. To install, place the “MacsBug” file
  13.         into your System folder and restart your machine.
  14.  
  15.         “into MacsBug Preferences folder” - This contains optional debugger commands (“dcmds”).
  16.         There are currently two dcmds in this folder; Leaks and PageFaults. Leaks is no longer
  17.         included within MacsBug because it patches a number of Memory Manager traps with 68K code,
  18.         potentially slowing down the system. PageFaults isn’t installed because it patches the
  19.         virtual memory system, also potentially slowing down some operations. To install either
  20.         dcmd, copy the appropriate file into your “MacsBug Preferences” folder, which is located
  21.         in your “Preferences” folder.
  22.  
  23.         “into Debugger Prefs file” - This contains the standard U.S. 'KCHR' keyboard translation
  24.         resource. It is needed when using MacsBug to debug on a system that is using a non-U.S.
  25.         keyboard layout (MacsBug requires U.S. keyboard translation). To install, copy the
  26.         'KCHR' resource from this file into your “Debugger Prefs” file using ResEdit, or rename
  27.         the file to “Debugger Prefs”. The file must be located in the System Folder.
  28.  
  29.         “Building dcmds” - This contains sample C and Pascal source for a variety of dcmds, as
  30.         well as all headers and libraries necessary to build dcmds within the MPW and Metrowerks
  31.         CodeWarrior environments.
  32.  
  33.     • The set of dcmds that was previously distributed in the optional file “PowerPC dmcds” has
  34.     been merged into MacsBug itself. When installing MacsBug, you should make sure to
  35.     remove this file from your “MacsBug Preferences” folder.
  36.  
  37.     • When MacsBug is first entered, it displays a message if it has encountered dcmds that have
  38.     the same name. If you see this message, you should examine all of your preference files and
  39.     remove any duplicates. MacsBug does not guarantee which dcmd is used when a name
  40.     collision occurs, so you may be accidentally using an old dcmd.
  41.  
  42.  
  43.     A-TRAPS
  44.  
  45.     • Fixed a problem with ATC (A-Trap Clear) command where you could clear all of your A-Traps by
  46.             accident. If you specified a trap or trap range that didn't coincide with any set ranges, we'd
  47.             silently clear all breaks. We now don't clear any ranges, and warn when you specify an invalid
  48.             trap or range.
  49.  
  50.  
  51.     BREAKPOINTS
  52.  
  53.     • When you set a breakpoint in PowerPC code, MacsBug doesn't know to set a PowerPC
  54.     breakpoint unless you use the BRP (BReakpoint PowerPC) command. If you accidentally use the
  55.     BR (BReakpoint) command, MacsBug trusts you and places a 68K breakpoint at the requested
  56.     address. If this code is excecuted, it will most likely result in an illegal PowerPC instruction. If
  57.     this happens, MacsBug will display the message:
  58.  
  59.        NOTE: It looks like you set a 68K breakpoint (BR) in PowerPC code.
  60.        See ?BR and ?BRP. You can probably clear the breakpoint (BRC) and go on.
  61.  
  62.  
  63.     COMMAND LINE
  64.  
  65.     • Command-quote (' or ") puts double quotes around the word you're typing. For example, if
  66.     you're typing “FRAGS "Navigation Real"” you can type Command-quote just before the blank,
  67.     and keep typing.
  68.  
  69.     • Added Control-U, which behaves just like like Control-X (clear the entire command line);
  70.     Control-D does a forward-delete; Control-A moves the cursor to the beginning of the line;
  71.     Control-E moves the cursor to the end of line.
  72.  
  73.     • If an entered command line causes a syntax error, we now show the fully-expanded command
  74.     line in case there were macros involved.
  75.  
  76.     • The insertion cursor now blinks based on PowerPC timebase timing, so it should be more
  77.     accurate.
  78.  
  79.     • The command line history size has been increased from 150 bytes to 1K (this is the Command-V/
  80.     Command-B history).
  81.  
  82.  
  83.     CONTEXTUAL MENUS
  84.  
  85.     • This is a new feature in MacsBug. Contextual menus are available in three general locations; the
  86.     history area, the stack/registers area, and the command line.
  87.             
  88.         History Area - This area has two modes of operation. If you hold down the control key when
  89.         clicking, a pop-up menu will be displayed that has items relevant to the type of data clicked.
  90.         If you select an item, the command will be executed using the hilighted data as the input
  91.         expression. If you click in the history area without the control key down, a hilight area will
  92.         track live as you drag. If the mouse is released, the selected text will be inserted into the
  93.         command line. If you click in whitespace between two 16-bit hex values, they will be entered
  94.         as one long word.
  95.             
  96.         Stack/registers Area - Here you can click on a number of items to get more information.
  97.  
  98.             - 68K and PowerPC registers
  99.             - CurApName
  100.             - Interrupt Level
  101.             - Virtual/Real memory status
  102.  
  103.         Command Line - Clicking here shows a pop-up menu that allows you to browse and reexecute
  104.         old command lines (the items shown are the same as those from the Command-V/Command-B
  105.         history).
  106.             
  107.  
  108.     DISASSEMBLY
  109.  
  110.     • If you accidentally use one of the PowerPC commands that allows an implied PC such as ILP,
  111.     IRP, IDP, etc., but the current PC is 68K, we now use the 68K PC, rather than a random address.
  112.  
  113.     • The PowerPC instructions “blr” and “bctr” will no longer show “Will branch” when
  114.     disassembled at the current PC.
  115.  
  116.  
  117.     EXPRESSIONS
  118.     
  119.     • We now allow registers from other ISAs in break conditions. This means you can type things
  120.     like:
  121.  
  122.         TVB Gestalt r3='nin '
  123.  
  124.             when the PC is in 68K code.
  125.  
  126.  
  127.     HEAP COMMANDS
  128.  
  129.     • “HC ALL” (Heap Check) now reports System heap and Process Manager extra space. This extra
  130.     space is the amount of free space between the highest non-free block in the System heap and the
  131.     lowest non-free block in the Process Manager heap.
  132.             
  133.     • “HD” (Heap Dump) and “HT” (Heap Total) now show values in K or M, in addition to byte
  134.     counts.
  135.  
  136.     • “HD” (Heap Dump) shows the names of code fragments if they are contained in any heap blocks
  137.     shown.
  138.  
  139.     • All heap commands now properly support debugging versions of the Modern Memory Manager.
  140.  
  141.  
  142.     LOG COMMAND
  143.  
  144.     • “LOG” inside an EVERYTIME or FIRSTTIME macro no longer waits for a key press.
  145.  
  146.     • “LOG -h” tells you the current log status when it's done (which is, the log is still open).
  147.  
  148.  
  149.     MACROS
  150.  
  151.     • Macro expansion has been fixed so that macro text longer then 127 characters works.
  152.  
  153.  
  154.     MACSBUGAPP
  155.  
  156.     • If you terminate MacsBugApp abnormally, such as when you “ES” (Exit to Shell) from the real
  157.     MacsBug, we now clean up properly by patching ExitToShell.
  158.  
  159.     • MacsBugApp does fewer MacsBug-like things, such as occasionally disabling interrupts. This
  160.     should make it more reliable.
  161.  
  162.  
  163.     MEMORY COMMANDS
  164.  
  165.     • When displaying an IOTRAPWORD basic type, we now special case selectors $51 (PBReadFork) and
  166.     $52 (PBWriteFork) to look up HFSPlusDispatch ($A0A8).
  167.  
  168.     • The IOREFNUM basic type understands HFS Plus iterators.
  169.  
  170.     • “SB” (Set Byte), “SW” (Set Word), and “SM” (Set Memory) can now be used on addresses that lie
  171.     within file mapped files.
  172.  
  173.     • Added the “FINDMASK” command. This allows you to search through a range of memory for data
  174.     that, when ANDed with the specified masks, matches the specified values.
  175.  
  176.     • Removed the “FP” (Find Pointer) command. This was useful in the days of 24-bit memory
  177.     addressing, but it's obsolete today.
  178.  
  179.     • “F” (Find), “FB” (Find Byte), “FW” (Find Word), and “FL” (Find Long) are two to three times
  180.     faster and provide a progress bar. Searches can be cancelled by typing Command-'.' (period).
  181.  
  182.     • Enumeration macros can use decimal now. Previously the enum macro value had to be hex.
  183.  
  184.     • Fixed the display of the RGNHANDLE basic type so that it doesn't abort when the handle seems
  185.     correct but the dereferenced handle causes a bus error.
  186.  
  187.     • Add “DS” (Display memory Strings) command. This searches through memory and displays the
  188.     first string of characters that match a given criteria. A valid string has all characters in the ASCII
  189.     range #32..#127, and has a minimum specified length, which defaults to five characters.
  190.  
  191.     The following example finds all strings in the current application heap that are at least 20
  192.     characters long.
  193.             
  194.     DS InApp #20
  195.                 
  196.  
  197.     MENU BAR
  198.  
  199.     • This is a new experimental feature in MacsBug. It is off by default, but can be dynamically
  200.     enabled with the “SET MENUBAR” command. To enable the menu bar by default, copy the ‘mxpr’
  201.     and ‘TMPL’ resources from MacsBug into your “Debugger Prefs” file, then edit the ‘mxpr’, and set
  202.     the “Show MacsBug menu bar” bit.
  203.  
  204.  
  205.     MISCELLANEOUS
  206.  
  207.     • When appropriate, MacsBug now uses the File System Manager FCB accessor functions to get
  208.     information on open files, rather than accessing the FCB table directly. This is for compatibility
  209.     with Mac OS 9.
  210.  
  211.     • If you crash a PowerPC application and then “ES” (Exit to Shell), MacsBug now sets the low
  212.     memory location DSErrCode to a reasonable non-zero value. The Process Manager captures
  213.     DSErrCode and sends it to the parent process in the child-died event, so you'll now see the
  214.     message, “The application <blah> has unexpectedly quit...” just like you do with 68K applications.
  215.  
  216.     • Entering MacsBug no longer causes the Macintosh to lose the network connection when booted
  217.     from a NetBoot server.
  218.  
  219.     • The mouse is properly refreshed when MacsBug is entered, the “Don't swap display bit depth”
  220.     danger bit is set, and the display bit depth has been changed.
  221.  
  222.     • MacsBug calls the G4 processor “7400 (G4)”.
  223.  
  224.     • Text is now highlighted in various colors to show errors, warnings, etc.
  225.  
  226.     • Added a ‘vend’ resource with the MacsBug updates URL. This is displayed by Conflict Catcher 8,
  227.     for example.
  228.  
  229.     • “SET UNMANGLE” re-displays the PC window in case your PC is inside a C++ routine when you
  230.     change the unmangle setting.
  231.  
  232.     • Removed the “EA” (Exit to Application) command. Use “ES” (Exit to Shell) instead.
  233.  
  234.     • MacsBug now has a 40K stack (bloated for now). This works around some problems where the
  235.     stack would overflow on some machines.
  236.             
  237.     • Symbol lookups will no longer deadlock the machine if done while the file system is busy, and
  238.     VM is on (but it's not VMs fault). This bug was introduced in MacsBug 6.5.4a7c1.
  239.  
  240.  
  241.     MULTITASKING
  242.     
  243.     • MacsBug now supports basic debugging of MPTasks. It requires a 2.0 or later version of the
  244.     MPLibrary. You can debug one task at a time, including stepping, tracing, breakpoints, and TVector
  245.     breaks.
  246.  
  247.  
  248.     SHOW COMMAND
  249.  
  250.     • Extra Return presses after “SHOW <foo>” cycle through the different display modes like “SHOW”
  251.     already did without parameters.
  252.  
  253.  
  254.     STAT COMMAND
  255.  
  256.     • “STAT -i” shows interesting internal MacsBug statistics such as memory use, stack use, and
  257.     dcmd size.
  258.  
  259.     • Added subliminal VM related message to the “STAT” command since VM does not suck.
  260.  
  261.  
  262.     SYMBOL LOOKUP
  263.  
  264.     • “WH” (WHere) can now say the address is “in the <foo> dcmd inside MacsBug”.
  265.  
  266.  
  267.     TASKLEVEL
  268.  
  269.     • “TASKLEVEL” is now more reliable. The test for Secondary Interrupt time would sometimes give
  270.     false positive results (the bit would be set when a secondary interrupt task was installed, and
  271.     immediately run at non-interrupt time). We would also report that VBLs were active just because
  272.     a page fault was in progress.
  273.             
  274.     An easy way to use TaskLevel is with the “TL” macro.
  275.             
  276.         BR NewHandle TL!=0
  277.                  
  278.     breaks on NewHandle when TaskLevel is not equal to zero.
  279.  
  280.  
  281.     WATCH POINTS 3.0
  282.  
  283.     • Completely rewritten, once again. This version is compatible with Mac OS 8.6 and 9.0, and
  284.     supports the PowerPC Velocity Engine (AltiVec™) instructions.
  285.             
  286.     • Due to a bug in the 68K Emulator, MacsBug requires Emulator Update Extension 2.0 (included
  287.     with MacsBug 6.6) to have patched the Emulator. This means you can't presently do Watch Points
  288.     until INIT time. MacsBug will let you know if the current Emulator doesn't have the bug fixed.
  289.     This bug is fixed on NewWorld-architecture (ROM-in-RAM) machines running Mac OS 9.
  290.  
  291.     • You can't watch locations on the stack. If you do, you'll eventually bus error with the stack
  292.     pointer off in hyperspace. We understand this, but don't yet have a deliverable fix (it's not
  293.     MacsBug).
  294.  
  295.     • You can't watch a location that is within a page that someone will be using atomic operations to
  296.     (lwarx/stwcx). If you do, the reservation will always be lost, and the atomic operation will loop
  297.     forever. If the machine seems to lock up, and you NMI in at the previous instruction is a “stwcx.”,
  298.     you need to clear the Watch Point to make forward progress. This is due to a NanoKernel feature.
  299.     It's not clear if this can be fixed without completely replacing the NanoKernel.
  300.  
  301.     • If you try to set a watch point in I/O space or ROM, we now display a useful error message
  302.     instead of pretending that the watch point has actually been set.
  303.  
  304.     • Made “WP” with no parameters work right when there is a watch point set (it shows the currently
  305.     set watch point).
  306.             
  307.     • Fixed a case where we'd hit a protected page, but our exception handler wouldn't see the hit.
  308.  
  309.     • Break expressions now work.
  310.  
  311.  
  312.     DCMDS, PREDEFINED MACROS, AND DCMD SUPPORT
  313.     
  314.     • When checking for duplicate dcmds, we now show if any dcmd names collide with built-in
  315.     command names.
  316.  
  317.     • Added a “Startup Actions” preference file. The version that ships with MacsBug contains a
  318.     FIRSTTIME macro that turns on the “EBBE” (Even Better Bus Error) dcmd. In general, you
  319.     shouldn't install this unless you're actively looking for write-to-nil/read-from-nil bugs.
  320.  
  321.     • Added a bunch of new macros:
  322.             
  323.             AEWH, AEWHS, AEBRK - AppleEvent stuff
  324.             APIB, APIC - API Break (set breaks with both ATB and TVB), API Clear (clear both ATB and TVB)
  325.             FIEL -> FILE - For poor spellars
  326.             “Files”, “Driver” and “Drivers” - Simple aliases to “File” and “Drvr” dcmds
  327.             Threads - Simple alias to the “Scream” dcmd
  328.             WNEA, WNEP, WNEPA, WNEFNDR, WNEF - Break at next WaitNextEvent call
  329.  
  330.     • Replaced the “-b” option to the Drvr dcmd in ShowLog with “-v”, show parameter block at
  331.     qHead if the driver is busy, added Drive, “vol”, “dm sp 80”, and Process Manager heap totals.
  332.  
  333.     • Add IOPosMode enum, which is used in HFS/HFS Plus parameter blocks.
  334.  
  335.     • Changed various ParamBlockRec templates to use the VRefNum type.
  336.  
  337.     • Added UTVolCacheReadIP, UTVolCacheWriteIP, UTResolveFileRefNum, UTCheckFCB,
  338.     UTCheckForkPermissions, UTAddFCBToSearchList, UTRemoveFCBFromSearchList,
  339.     UTLocateFCBInSearchList, UTGetForkControlBlockSize, PBGetXCatInfoSync/Async, HFS
  340.     Plus API stuff for the HFSPlusDispatch (A0A8) trap, IPCKillListPorts, GetDimSuspendState,
  341.     SetDimSuspendState, and ServerDispatch
  342.             
  343.     • HighLevelFSDispatch (AA52) and AliasDispatch (A823) had the wrong selector sizes.
  344.  
  345.  
  346.     • Aevt - 1.1
  347.     
  348.     This is a new dcmd that displays the contents of an AppleEvent record.
  349.  
  350.     • ATVB - Removed. Use TVB instead.
  351.  
  352.     • Cache - 3.0
  353.  
  354.     Use File System Manager FCB accessors for Mac OS 9 compatibility.
  355.  
  356.     • DRD - 3.0
  357.  
  358.     We now try to show the routine name and address, so you don't have to manually dereference the
  359.     ProcPtr value if it points to PowerPC code.
  360.  
  361.     • Drive - 2.0.1
  362.  
  363.     Added 'W' flag for drive is non-ejectable but wants eject call.
  364.  
  365.     • Drvr - 3.1
  366.  
  367.     Added “-v” (verbose) option.
  368.  
  369.     • EBBE - 2.1
  370.  
  371.     Changed from kEbbeValue (0x50FF8001) to kBlessedBusErrorBait (0x68F168F1). This new
  372.     value will be guaranteed to be in the middle of a 64K unmapped range on Mac OS 8 and 9.
  373.  
  374.     Added “-v” (set EBBE value) option.
  375.  
  376.     • Error - 3.2
  377.  
  378.     Changed hMenuFindErr to fsDSIntErr.
  379.  
  380.     Fixed typo in opWrErr.
  381.  
  382.     • File - 4.0
  383.  
  384.     Pretty much a complete rewrite. It now handles multiple command line options correctly, so you
  385.     can use things like:
  386.             
  387.         FILE -p 2001 -t 'TEXT'
  388.  
  389.     to show files opened by process 2001 that are of type text.
  390.             
  391.     Use File System Manager FCB accessors for Mac OS 9 compatibility.
  392.  
  393.     “FILE fRefNum” now dumpes the FCBRec, ForkControlBlock, or IteratorControlBlock
  394.     (whichever is appropriate) unless the “-s” option is used. This supports Mac OS 9's HFS Plus
  395.     APIs.
  396.              
  397.     Added code to display sizes 4 GB or larger.
  398.  
  399.     Add “-s” option to replicate old, minimal display of the specified file.
  400.  
  401.     • Frags - 1.1
  402.  
  403.     By default, check for lib-name-contains-string instead of equals-string. If you want to check for an
  404.     exact match, use the new option “-x”.
  405.  
  406.     Add “-i” to show a fragment’s import libraries.
  407.  
  408.     Display all context, closure and connection IDs in hex.
  409.  
  410.     • Gestalt - 3.2
  411.  
  412.     No changes other than the version.
  413.  
  414.     • Leaks - 6.6.1
  415.  
  416.     Fixed bus-error handling to restore the SR (re-enter User mode) after catching a bus error when
  417.     stack crawling.
  418.  
  419.     “LEAKS DUMP” displays the depth of the internal tree.
  420.  
  421.     Display “[end of Leaks display]” at the end of a dump, so you don't have to wonder if it's
  422.     done yet (watching for the blinking insertion point is a mediocre workaround).
  423.  
  424.     Leaks can now track 2,000 blocks.
  425.  
  426.     • PageFaults. - 1.0
  427.  
  428.     Use File System Manager FCB accessors for Mac OS 9 compatibility.
  429.  
  430.     • PP - 2.0
  431.  
  432.     No changes other than the version.
  433.  
  434.     • RD - 3.0.3
  435.  
  436.     Use File System Manager FCB accessors for Mac OS 9 compatibility.
  437.  
  438.     • Scream - 2.1
  439.  
  440.     Added display of thread entry pointer, creation flags, termination proc/data, pointer to thread app
  441.     globals and pointer to thread record sturcture.
  442.  
  443.     • ShowPath - 1.0
  444.  
  445.     This is a new dcmd that displays a full path to a specified file or directory. This dcmd, like the Log
  446.     command, is best used at TaskLevel 0.
  447.  
  448.     • StopAS - 3.0
  449.  
  450.     No changes other than the version.
  451.  
  452.     • Thing
  453.  
  454.     Made the tRefNum functionality actually work. The dcmd now displays only the component
  455.     matching the given tRef number if your parameter is an unquoted number.
  456.  
  457.     • UserFns - 1.0
  458.  
  459.     Display interrupt level correctly (including Time Mgr tasks).
  460.  
  461.     • VMDump - 3.0
  462.  
  463.     Use File System Manager FCB accessors for Mac OS 9 compatibility.
  464.  
  465.     • Vol - 3.0.2
  466.  
  467.     Updated for HFS Plus volumes to show real number of blocks and real block size. Enlarged a few
  468.     field sizes so larger values can be shown. Some fields are still truncated to 6 hex digits, but that is
  469.     enough for any normal volume (we do not expect to see volumes with a block size, file count, or
  470.     directory count 16M or greater for a while).
  471.  
  472.     • WhatIs - 1.0
  473.     
  474.     This is a new dcmd that explains what a given PowerPC mnemonic means.
  475.  
  476.  
  477. © 1999 Apple Computer, Inc. All rights reserved.
  478.  
  479. Apple, the Apple logo, Apple IIGS, Macintosh, MPW, Power Macintosh, and PowerBook are trademarks of Apple Computer, Inc., registered in the United States and other countries. PowerPC is a trademark of International Business Machines Corporation, used under license therefrom. AltiVec is a trademark of Motorola, Inc.